package com.qfjy.project.meeting;

import com.qfjy.common.utils.result.ResultCode;
import com.qfjy.common.utils.result.ResultJson;
import com.qfjy.entity.po.MeetingType;
import com.qfjy.service.MeetingTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @ClassName MeetingTypeController
 * @Description TODO
 * @Author guoweixin
 * @Date 2022/12/5
 * @Version 1.0
 */
@Controller
@Slf4j
@RequestMapping("meetingType")
public class MeetingTypeController {

    @Autowired
    private MeetingTypeService meetingTypeService;

    @GetMapping("list")
    @ResponseBody
    public ResultJson  selectMeetingTypeList(){

        List<MeetingType> list=meetingTypeService.selectMeetingTypeByStatus();
        if(list.size()==0){
            return new ResultJson(null, ResultCode.NOT_DATA);
        }
        return new ResultJson(list,ResultCode.SUCCESS);
    }
}
